Digital imaging may create digital images, typically from a physical object. A digital image may be created directly from a physical scene by a camera or similar devices. Alternatively, a digital image may be obtained from another image in an analog medium, such as photographs, photographic film or printed paper, and may be converted to a digital medium by a scanner or similar device. Many technical images, such as those acquired with topographic equipment, such as computed tomography (CT) scans, side-looking radar or radio telescopes, are obtained by complex processing of non-image data. Finally, a digital image may also be computed from a geometric model or mathematical formula.
A digital image may include pixels. A pixel may be the smallest piece of information in an image. Pixels are normally arranged in a regular two dimensional grid, and are often represented using dots, squares, or rectangles. Each pixel may have a value that represents a property of a sample of an original image. Increasing the density of pixels or samples typically provides a higher resolution or more accurate representation of the original image. The intensity of each pixel may be variable. In color systems, each pixel may have three or four color components such as red, green, and blue, or cyan, magenta, yellow, and black.
Image resolution may measure the quality of an image. Image resolution may be defined by the pixel dimensions in a digital image. An image that is an integer, N, pixels high by an integer, M, pixels wide may have any resolution less than or equal to N×M pixels (spanning N lines of picture height or N TV lines). Another popular convention defines resolution as the total number of pixels in the image, typically given as a number of megapixels, which may be calculated by multiplying pixel columns by pixel rows (N×M) and dividing by one million. Other conventions define resolution by pixels per length unit or pixels per area unit, such as pixels per inch or per square inch. These calculated pixel resolutions are generally inexact (the true resolutions may be smaller than the calculated resolutions) and may serve as approximations or upper bounds of the true image resolution. Generally, the higher the resolution is, the more details are presented in the picture.
Pixels may be stored in a computer memory as a raster image or raster map, or bitmap: a two-dimensional array of small integer values. These values are often transmitted or stored in a compressed form. Each pixel of a raster image is typically associated with a specific “position” in a two-dimensional (2D) image region and values of one or more image features at that position. Digital images may be classified according to the number and nature of those pixel samples.
Image compression may reduce redundancy of the image data in order to decrease the amount of image information to be stored or transmitted. Image compression may be “lossy” (when the decompressed data is different from the original due to loss of data) or “lossless” (when the decompressed data substantially exactly matches the original data). Lossy data may be used when the lost data is sufficiently small or when the benefit of data reduction outweighs the damages due to data loss. Lossless data compression allows the exact original data to be reconstructed from the compressed data. Lossless compression may be used when it is important for the original and the decompressed data to be identical, or when the importance of exact duplication or an allowable deviation therefrom is unknown. Typical data types compressed by lossless data compression are executable programs and source code. Some image file formats, like Portable Network Graphics (PNG) or Graphics Interchange Format (GIF), typically use only lossless compression, while others like Tagged Image File Format (TIFF) and Multiple-image Network Graphics (MNG) may use either lossless or lossy compression.
Compression mechanisms may require different amounts of processing power to encode and decode. The quality of a compression method is often measured by a peak signal-to-noise ratio. The peak signal-to-noise ratio may measure the amount of error or noise introduced through a lossy compression of the image. However, the subjective judgment of the viewer is also regarded as an important, perhaps the most important, measure of compression accuracy.